package niuke.meituan2021;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @author: 唐小尊
 * @email: 1171702529@qq.com
 * @cate: 2021/03/17 15:15
 */
public class one {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int x = sc.nextInt();
        int y = sc.nextInt();
        System.out.println("输入成绩");
        int[] scores = new int[1001];
        Arrays.fill(scores,0);
        int scoreNum = n;
        while (scoreNum>0) {
            int nowScore = sc.nextInt();
            scores[nowScore]++;
            scoreNum--;
        }
        if(2*y<n||2*x>n){
            System.out.println(-1);
        }
        int peoNum = 0;
        for(int i=1;i<1001;i++){
            peoNum+=scores[i];
            if(peoNum>y){
                System.out.println(-1);
                break;
            }
            if(peoNum>=x&&peoNum<=y&&n-peoNum<=y&&n-peoNum>=x){
                System.out.println("最佳分数线为："+i);
                break;
            }
        }
    }
}
